cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

include_directories(${CMAKE_CURRENT_SOURCE_DIR})

find_package(LibNav REQUIRED)
include_directories(${LibNav_INCLUDE_DIRS})
set(LIBS ${LibNav_LIBRARIES})

find_package(LibHdf4utils REQUIRED)
include_directories(${LibHdf4utils_INCLUDE_DIRS})
list(APPEND LIBS ${LibHdf4utils_LIBRARIES})

find_package(LibTimeutils REQUIRED)
include_directories(${LibTimeutils_INCLUDE_DIRS})
list(APPEND LIBS ${LibTimeutils_LIBRARIES})

find_package(GSL REQUIRED)
include_directories(${GSL_INCLUDE_DIRS})
list(APPEND LIBS ${GSL_LIBRARIES})

ADD_LIBRARY(seawifs
  geonav.f
  geonav_lonlat.f
  get_cal_swf.c
  get_cal.c
  get_cal_misc.c
  calibrate_l1a.c
  l1a.c
  lac_st.c
  gac_st.c
  out_band_corr.c
  st_lt.c
  GetStationInfo.c
)

target_link_libraries(seawifs ${LIBS})

install (TARGETS seawifs DESTINATION lib)
